home *** CD-ROM | disk | FTP | other *** search
- Path: in1.uu.net!interaccess!usenet
- From: brianmcg@interaccess.com (Brian V. McGroarty)
- Newsgroups: comp.lang.c
- Subject: Re: a typedef question
- Date: 19 Mar 1996 14:47:51 GMT
- Organization: Internet Squire
- Message-ID: <4imhen$12b@nntp.interaccess.com>
- References: <4ilq55$4oo@newserv.ksu.ksu.edu>
- Reply-To: brianmcg@interaccess.com
- NNTP-Posting-Host: d46-isdn.nhe.interaccess.com
- X-Newsreader: Internet Squire 1.20
-
- Since struct A would contain B and B would contain A, you would have an
- infinitely large structure! Depending on what you are trying to do, you
- may want instead to include a pointer to the other structure instead of a
- copy of the actual structure, or you may want to make another structure
- which contains one of each of the other structures.
-
-
-
- Bin Chen wrote:
- >Here is the question:
-
- > typedef struct A {
- > ......
- > struct B one_attr;
- > ......
- > };
-
- > typedef struct B {
- > ......
- > struct A two_attr;
- > ......
- > };
-
- >Is this OK? How do you make it correct if it is not right?
-
-
- ---
- Brian Valters McGroarty -- brianmcg@bix.com
- phone/fax (847) 439-7714
-
-
-